package com.ywjt.platformbusiness.home.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.classify.model.HomeRecommonShopModel;
import com.ywjt.platformbusiness.home.CommonModel;

import java.util.List;

public class HomeRecommondStoreAdapter extends BaseQuickAdapter<HomeRecommonShopModel.ResultDTO, BaseViewHolder> {

    public HomeRecommondStoreAdapter(@Nullable List<HomeRecommonShopModel.ResultDTO> data) {
        super(R.layout.item_home_recommondstore, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeRecommonShopModel.ResultDTO item) {
        ImageView ivGoodsImg=helper.getView(R.id.ivGoodsImg);
        helper.setText(R.id.tvGoodsName,item.getShopName());
        Glide.with(mContext).load(item.getShopPhoto()).
                placeholder(R.mipmap.home_recommon_shop_default)
                 .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
                .into(ivGoodsImg);
    }
}
